package com.itheima.tliassystem.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.springframework.stereotype.Component;
// 定义切面类
//定义模版方法
//定位需要进行编程/功能增强的目标方法
@Component
//@Aspect
public class TImeAspect {
    @Around("execution(* com.itheima.tliassystem.service.*.*(..))")
public  Object contTime(ProceedingJoinPoint PJP) throws Throwable {
        long begin = System.currentTimeMillis();
        Object proceed = PJP.proceed();
        long end = System.currentTimeMillis();
        System.out.println("方法执行时间："+(end-begin)+"执行了"+PJP.getSignature().getName()+"方法");

return proceed;
    }

}
